import java.math.*;
import java.util.*;

public class Main{
/* 换汽水
 * public static void main(String[] args) {  
	Scanner input = new Scanner(System.in);
	int n = 0;
	int[] count = new int[10];
	int i =0;
	while(!((n=input.nextInt())==0))
	{	
	    while(true){
	    	count[i]  += n/3;
	        n = n/3 + n%3;
	        if(n==2) 
	        {
	        	count[i] +=1;
	            break;     
	        }
	        else if(n==1 || n==0) break;
	    }
	    i++;
	   
	}
	
	for(int j=0;j < i; j++)
	{
	 System.out.println(count[j]);
	}
	input.close();
	}
/*检查作业
	public static void main(String[] args){
	Scanner input = new Scanner(System.in);
	int count = 0;
	String inStr = null;
	while(input.hasNext()){
		inStr = input.nextLine();
		int len = inStr.length();
		int a = 0;
		int b = 0;
		int c = 0;
		String tmp="";
		char x = '0';
		if(!inStr.contains("?")){
		for(int i=0;i<len;i++){
			tmp += inStr.charAt(i);
			if(inStr.charAt(i)=='+'||inStr.charAt(i)=='-'){
				int end = tmp.length()-1;
				a =  Integer.parseInt(tmp.substring(0, end));
				x = inStr.charAt(i);
				tmp = "";
			}
			else if(inStr.charAt(i)=='='){
				b =  Integer.parseInt(tmp.substring(0, tmp.length()-1));
				tmp = "";
			}
		}
		c = Integer.parseInt(tmp);
		if(x == '+' && a+b == c)  count++;
		if(x == '-' && a-b == c) count++;
		}
	}
	System.out.println(count);
}
/* 整除数字
public static void main(String[] args){
	Scanner input = new Scanner(System.in);
	String data = "";
	String tmp = "";
	String tmplast = "";
	int[] result = new int[10];
	int i = 0;
	while(input.hasNext()){
		tmp = "";
		tmplast = "";
		data=input.nextLine();
		if(data.equals("0")) break;
		int len = data.length();
		for(int j =0;j<len-1;j++){
			tmp += data.charAt(j);
		}
		tmplast += data.charAt(len-1);
		BigInteger least = new BigInteger(tmp);
		BigInteger last = new BigInteger(tmplast);
		BigInteger a = new BigInteger("5");
		BigInteger b = new BigInteger("17");
		if(least.subtract(last.multiply(a)).mod(b).intValue() == 0)
			result[i] = 1;
		i++;
		
	}
	for(int j=0;j<i;j++){
		System.out.println(result[j]);
	}
	input.close();
}
*/
public static void main(String[] args) 
{  
		Scanner input = new Scanner(System.in);
		int[] data = new int[10];
		int[] adata = new int[10];
		int[] tmp = new int[10];
		int[] tmps = new int[10];
		//String in = null;
		//String[] tmpin = new String[]{};
		//ArrayList reslut = new ArrayList();
		//String rtmp ="";
		while(input.hasNext())
		{
			/*行处理
			rtmp = "";
			in = input.nextLine();
			if(in.equals("0")) break;
			tmpin = in.split(" ");
			*/
			for(int i = 0;i<10;i++){
				//tmp[i]=Integer.parseInt(tmpin[i]);
				tmp[i] = input.nextInt();
				data[i] = tmp[i];
				adata[i] = Math.abs(tmp[i]);
			}
			tmps = adata.clone();
			for(int i =0;i<9;i++)
			{
				tmps[i+1] = Math.min(tmps[i], tmps[i+1]);
			}
			for(int i =0;i<10;i++)
			{
				if(adata[i]==tmps[9]) 
				{
					adata[i]=data[i];
					data[i]=data[9];
					data[9]=adata[i];
				}	
			}
			for(int i = 0;i<10;i++)
			{
				System.out.print(data[i]+" ");
			  //rtmp += data[i]+" ";
			}
			//reslut.add(rtmp);
		}
		/* 行处理
		for(int i = 0;i<reslut.size();i++)
		{
			System.out.println(reslut.get(i).toString());
		}
		*/
		//input应该关闭
		input.close();//关闭
	 }
}